home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / dskut / boot.zip / BOOT.ASM next >
Assembly Source File  |  1986-01-09  |  3KB  |  117 lines

  1. ;  Boot record program (C) Copyright Peter Norton 1986
  2.  
  3. boots segment 'code'
  4.  
  5.       public boot
  6.  
  7.       assume cs:boots
  8.  
  9. boot  proc  far
  10.  
  11. ;  30-byte DOS info -- set up for 1-side, 8-sector
  12. ;  change as needed for any other format
  13.  
  14. head:
  15.  
  16.       jmp   begin       ; EB 2A 90 as per normal
  17.       db    ' Norton '  ; 8-byte system id
  18.       dw    512         ; sector size in bytes
  19.       db    1           ; sectors per cluster
  20.       dw    1           ; reserved clusters
  21.       db    2           ; numbers of fats
  22.       dw    64          ; root directory entries
  23.       dw    320         ; total sectors
  24.       db    0FEh        ; format id
  25.       dw    1           ; sectors per fat
  26.       dw    8           ; sectors per track
  27.       dw    1           ; sides
  28.       dw    0           ; special hidden sectors
  29.  
  30. ; mysterious but apparently standard 14-byte filler
  31.       db    14 dup (0)
  32.  
  33. ;  carry on with the boot work
  34.  
  35. begin:
  36.       mov   ax,07c0h ; boot record location
  37.       push  ax
  38.       pop   ds
  39.       mov   bx,message_offset  ; put offset to message into si
  40.       mov   cx,message_length  ; message length into cx
  41. continue:
  42.       mov   ax,14   ; write teletype
  43.       mov   al,[bx]
  44.       push  ds
  45.       push  cx
  46.       push  bx
  47.       int   10h
  48.       pop   bx
  49.       pop   cx
  50.       pop   ds
  51.       inc   bx
  52.       loop  continue
  53.  
  54.       mov   ah,0     ; read next keyboard character
  55.       int   16h
  56.  
  57.       mov   ah,15    ; get video mode
  58.       int   10h
  59.       mov   ah,0     ; set video mode (clears screen)
  60.       int   10h
  61.  
  62.       int   19h      ; re-boot
  63.  
  64. beg_message:
  65.       db    0Dh,0Ah  ; return carriage, line feed
  66.       db    0Dh,0Ah
  67.       db    0Dh,0Ah
  68.       db    0Dh,0Ah
  69.       db    '     Start your computer with'
  70.       db    0Dh,0Ah
  71.       db    '     a DOS system diskette.'
  72.       db    0Dh,0Ah
  73.       db    0Dh,0Ah
  74.       db    0Dh,0Ah
  75.       db    '     This is'
  76.       db    0Dh,0Ah
  77.       db    '         The Norton Utilities'
  78.       db    0Dh,0Ah
  79.       db    '             Version 3.10    '
  80.       db    0Dh,0Ah
  81.       db    0Dh,0Ah
  82.       db    '     from'
  83.       db    0Dh,0Ah
  84.       db    '         Peter Norton'
  85.       db    0Dh,0Ah
  86.       db    '         2210 Wilshire Blvd'
  87.       db    0Dh,0Ah
  88.       db    '         Santa Monica, CA 90403'
  89.       db    0Dh,0Ah
  90.       db    0Dh,0Ah
  91.       db    '           (213) 826-8032'
  92.       db    0Dh,0Ah
  93.       db    0Dh,0Ah
  94.       db    0Dh,0Ah
  95.       db    0Dh,0Ah
  96.       db    '    Insert a DOS diskette'
  97.       db    0Dh,0Ah
  98.       db    '    press any key to start DOS ... '
  99. end_message:
  100.  
  101. ; I put a copyright notice here; you do if you want to
  102. tail:
  103.  
  104. message_offset equ beg_message - head
  105. message_length equ end_message - beg_message
  106. filler_amount  equ 512 - (tail - head) - 2
  107.  
  108.       db    filler_amount dup (0)  ; filler
  109.  
  110.       db    055h,0AAh              ; boot id
  111.  
  112. boot  endp
  113.  
  114. boots ends
  115.  
  116.       end
  117.